/**
 * Author: Shen Yanqiu
 * Date: 2017-12-11
 * Time: 16:57
 *
 */
import configs from '../src/config';
import Mock from "mockjs";

const { mockAPIPrefix } = configs;

export default {

  [`GET ${mockAPIPrefix}/organization/community`] (req, res) {
    const communityList = [{
      value: 'community1',
      label: '学生会',
      children: [{
        value: 'department11',
        label: '新闻部',
      }, {
        value: 'department12',
        label: '宣传部',
      }],
    }, {
      value: 'community2',
      label: '志愿者',
      children: [{
        value: 'department21',
        label: '社区服务',
      }, {
        value: 'department22',
        label: '绿色环保',
      }],
    }];
    setTimeout(() => {
      res.json({
        success: true,
        data: {
          community: communityList,
        },
      });
    }, 2000);
  },
};
